<?php
function calculate_seva_score($array_of_players)
{
	$calculated_score = 0;
	for($i=0;$i<sizeof($array_of_players); $i++){
		$player = $array_of_players[$i];
		$ppg = $player[0][" PPG"];
		$rpg = $player[0][" RPG"];
		$apg = $player[0][" APG"];
		$fgper = $player[0][" FG%"];
		$winper = $player[0][" Win%"];
		
		$calculated_score = ($ppg*.1) + ($rpg*.2) + ($apg*.2) + ($winper*.4) + ($fgper*.2);
		$array_of_players[$i][0]["generated_seva_score"] = $calculated_score;
	}
	//loops through the array and calculate a seva score based on the player stats
	return $array_of_players;
}
 